package com.uenpay.oem.net;

import com.uenpay.util.net.event.DefultEvent;
import com.uenpay.util.net.http.HttpParam;
import com.uenpay.util.rx.RxBus;

import rx.Observable;
import rx.functions.Action1;


/**
 * Created by PS on 2016/11/23.
 * desc:用于处 未操作、登录标识失效需要弹框等操作
 * 需要在application中初始化
 */

public class HttpErrorHandler {

    public static void regesiter(){
        Observable<DefultEvent> observable = RxBus.$().register(HttpErrorHandler.class.getSimpleName());
        RxBus.$().OnEvent(observable, new Action1<Object>() {
            @Override
            public void call(Object o) {
                DefultEvent event = (DefultEvent) o;
                if (Integer.valueOf(HttpParam.RsqCode.LoginInvalidated) == (event.getWhat())){

                }
            }
        });
    }

}
